<!DOCTYPE html>
<html>
<head>
    <meta name="viewport"
          content="width=device-width,height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="../stylesheets/bootstrap.min.css">
    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="../stylesheets/bootstrap-theme.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="../javascripts/lib/jquery-1.11.1.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="../javascripts/lib/bootstrap.min.js"></script>
    <script src="../javascripts/index.js"></script>
    <title><%= title %></title>
    <script>
        $(function () {
            $('#myTab a:eq(0)').tab('show')
        })
    </script>
    <style>
        .inputmgn{
            margin-top: 2em;
        }
    </style>
</head>
<body>
<div class="container-fluid">
    <div class="row" style="height:50px;background-color:#000000">
        <div class="col-md-6" style="color: #ffffff;line-height: 50px;font-size: 30px">
            <span>奇妙在线管理系统</span>
        </div>
        <div class="col-md-6" style="text-align: right;line-height: 50px;">
            <a href="/logout" style="color: #ffffff;">退出</a>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-3 col-md-2" style="padding: 0px 0px 0px 5px;">
            <ol class="breadcrumb">
                <li><a href="#">后台管理</a></li>
                <li>结算单管理</li>
            </ol>
            <ul class="nav nav-pills nav-stacked" role="tablist" id="myTab">
                <li role="presentation" class="active"><a a href="#home" aria-controls="home" role="tab" data-toggle="tab">用户列表</a></li>
                <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">新增用户</a></li>
                <!--<li role="presentation"><a href="#">Messages</a></li>-->
            </ul>
        </div>
        <div class="col-sm-9 col-md-10" style="padding: 0px 2px 0px 5px;">

            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="home">

                    <table class="table table-bordered table-striped table-condensed" style="margin-top:1px">
                        <thead style="background-color:beige">
                        <td>用户名称</td>
                        <td>手机</td>
                        <td>邮箱</td>
                        <td>应用ID</td>
                        <td>应用密钥</td>
                        <td>运行状态</td>
                        <td>创建时间</td>

                        </thead>
                        <tbody>
                        <% result.musers.forEach(function(muser){ %>
                        <tr style="height: 40px;">
                            <td><%= muser.user_name %></td>
                            <td><%= muser.phone %></td>
                            <td><%= muser.email %></td>
                            <td><%= muser.appID %></td>
                            <td><%= muser.appSecret %></td>
                            <!--<td><%= muser.appStatus %></td>-->
                            <% if(muser.appStatus == 0) { %>
                            <td>
                                <span>未启用</span>
                            </td>
                            <% } else{ %>
                            <td>
                                <span>正常</span>
                            </td>
                            <% } %>
                            <td><%= muser.createtime %></td>
                        </tr>
                        <% }) %>
                        </tbody>
                    </table>
                    <div  style="width: 100%;position:fixed; left:0; bottom:35px;text-align: center">
                        <ul class="pagination">
                            <% if(parseInt(result.page.current_page) == 1){ %>
                            <li><a href="/index/userPage?page=<%= result.page.current_page %>">&laquo;</a></li>
                            <% }else{ %>
                            <li><a href="/index/userPage?page=<%= result.page.current_page - 1 %>">&laquo;</a></li>
                            <% } %>

                            <% for(var i = 1;i <= result.page.total_page;i++){ %>
                            <% j = i %>
                            <% if(i == result.page.current_page){ %>
                            <li class="active"><a href="/index/userPage?page=<%= i %>"><%= i %></a></li>
                            <% }else{ %>
                            <li><a href="/index/userPage?page=<%= i %>"><%= i %></a></li>
                            <% } %>
                            <% } %>

                            <% if(result.page.current_page == result.page.total_page) { %>
                            <li><a href="/index/userPage?page=<%= result.page.current_page %>">&raquo;</a></li>
                            <% }else{ %>
                            <li><a href="/index/userPage?page=<%= parseInt(result.page.current_page) + 1 %>">&raquo;</a></li>
                            <% } %>
                        </ul>
                    </div>

                </div>
                <div role="tabpanel" class="tab-pane" id="profile" style="text-align: center;width: 100%;">

                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title">新增用户</h3>
                        </div>
                        <div class="panel-body">
                            <div style="width: 60%;margin-left: auto;margin-right: auto;">
                                <div class="input-group inputmgn">
                                    <span class="input-group-addon" id="user_name">用户名称</span>
                                    <input type="text" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                                <div class="input-group inputmgn">
                                    <span class="input-group-addon" id="user_passwd">密&emsp;&emsp;码</span>
                                    <input type="password" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                                <div class="input-group inputmgn">
                                    <span class="input-group-addon" id="phone">手&emsp;&emsp;机</span>
                                    <input type="text" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                                <div class="input-group inputmgn">
                                    <span class="input-group-addon" id="email">邮&emsp;&emsp;箱</span>
                                    <input type="email" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                                <div class="input-group inputmgn">
                                    <span class="input-group-addon" id="appID">应用&emsp;ID</span>
                                    <input type="text" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                                <div class="input-group inputmgn">
                                    <span class="input-group-addon" id="appSecret">应用密钥</span>
                                    <input type="text" class="form-control" placeholder="" aria-describedby="basic-addon1">
                                </div>
                                <div  style="margin-top: 30px;">
                                    <button type="button" class="btn btn-primary">提&emsp;交</button>
                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>
    </div>
    <div class="row" style="position: absolute;height: 35px;background-color: #000000;bottom: 0;width: 100%">

    </div>
</div>
</body>
</html>
